package Controller

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"gopkg.in/ini.v1"
	"io"
	"log"
	"math"
	"net/http"
	"strconv"
	"time"
	"web_back_go/Common"
	"web_back_go/DAO/gorm"
	"web_back_go/DAO/gorm/GormModel"
	"web_back_go/Dto"
	"web_back_go/Response"
	"web_back_go/Util"

	"github.com/gin-gonic/gin"
	"github.com/jinzhu/copier"
)

// OrderCountData 我的订单数量
type OrderCountData struct {
	AllCount    int `json:"allCount" description:"所有订单数量"`
	UnPay       int `json:"unPay" description:"待付款"`
	Payed       int `json:"payed" description:"待发货"`
	Consignment int `json:"consignment" description:"待收货"`
	Confirm     int `json:"confirm" description:"待评价"`
	Success     int `json:"success" description:"成功"`
	Close       int `json:"close" description:"失败"`
}

// MyOrderDto 对应 MyOrderDto 类，代表订单信息
type MyOrderDto struct {
	OrderNumber   string           `gorm:"column:order_number;type:varchar(50)" json:"orderNumber"`
	ActualTotal   float64          `gorm:"column:actual_total;type:decimal(15,2)" json:"actualTotal"`
	Status        int              `gorm:"column:status;type:integer" json:"status"`
	OrderItemDtos []MyOrderItemDto `gorm:"foreignKey:OrderNumber;references:OrderNumber" json:"orderItemDtos"`
}

// MyOrderItemDto 对应 MyOrderItemDto 类，代表订单项信息
type MyOrderItemDto struct {
	Pic         string  `gorm:"column:pic;type:varchar(255)" json:"pic"`
	ProdName    string  `gorm:"column:prod_name;type:varchar(120)" json:"prodName"`
	ProdCount   int     `gorm:"column:prod_count;type:integer" json:"prodCount"`
	Price       float64 `gorm:"column:price;type:decimal(15,2)" json:"price"`
	SkuName     string  `gorm:"column:sku_name;type:varchar(120)" json:"skuName"`
	OrderNumber string  `gorm:"column:order_number;type:varchar(50)" json:"-"` // 外键字段，不参与 JSON 序列化
}

// MyOrderRes 从数据库中获取到的信息
type MyOrderRes struct {
	OrderNumber string  `gorm:"column:order_number;type:varchar(50)" json:"orderNumber"`
	ActualTotal float64 `gorm:"column:actual_total;type:decimal(15,2)" json:"actualTotal"`
	Status      int     `gorm:"column:status;type:integer" json:"status"`
	Pic         string  `gorm:"column:pic;type:varchar(255)" json:"pic"`
	ProdName    string  `gorm:"column:prod_name;type:varchar(120)" json:"prodName"`
	ProdCount   int     `gorm:"column:prod_count;type:integer" json:"prodCount"`
	Price       float64 `gorm:"column:price;type:decimal(15,2)" json:"price"`
	SkuName     string  `gorm:"column:sku_name;type:varchar(120)" json:"skuName"`
}

func GetOrderCount(c *gin.Context) {
	//从请求头中获取用户Authorization
	token := c.GetHeader("Authorization")
	userId, _, err := Common.CodeToken(token)
	if token == "" || err != nil {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code: "A00004",
			Data: nil,
			Msg:  "UnauthorizedUnauthorized",
		})
	}
	/*
	   SELECT
	   COUNT(o.order_id) all_count,
	   COUNT( CASE WHEN o.status = 1 THEN o.order_id ELSE NULL END ) AS unPay,
	   COUNT( CASE WHEN o.status = 2 THEN o.order_id ELSE NULL END ) AS payed,
	   COUNT( CASE WHEN o.status = 3 THEN o.order_id ELSE NULL END ) AS consignment,
	   COUNT( CASE WHEN o.status = 4 THEN o.order_id ELSE NULL END ) AS confirm,
	   COUNT( CASE WHEN o.status = 5 THEN o.order_id ELSE NULL END ) AS success,
	   COUNT( CASE WHEN o.status = 6 THEN o.order_id ELSE NULL END ) AS `close`
	   FROM tz_order o
	   WHERE o.user_id =#{userId}
	*/
	var result OrderCountData

	db := gorm.Db
	//原生sql查询
	db.Raw("SELECT COUNT(o.order_id) all_count,COUNT( CASE WHEN o.status = 1 THEN o.order_id ELSE NULL END ) AS unPay,COUNT( CASE WHEN o.status = 2 THEN o.order_id ELSE NULL END ) AS payed,COUNT( CASE WHEN o.status = 3 THEN o.order_id ELSE NULL END ) AS consignment,COUNT( CASE WHEN o.status = 4 THEN o.order_id ELSE NULL END ) AS confirm,COUNT( CASE WHEN o.status = 5 THEN o.order_id ELSE NULL END ) AS success,COUNT( CASE WHEN o.status = 6 THEN o.order_id ELSE NULL END ) AS `close` FROM tz_order o WHERE o.user_id =?", userId).Scan(&result)

	c.JSON(http.StatusOK, Response.ResponseBody{
		Code:    "00000",
		Msg:     nil,
		Data:    result,
		Version: "1.0.0",
		Sign:    nil,
		Success: true,
		Fail:    false,
	})
}

// GetMyOrderList 订单列表
func GetMyOrderList(c *gin.Context) {
	token := c.GetHeader("Authorization")
	currentStr := c.Query("current")
	sizeStr := c.Query("size")
	statusStr := c.Query("status")

	// 将currentStr, sizeStr, statusStr 转为int
	current, err := strconv.ParseInt(currentStr, 10, 64)
	if err != nil {
		log.Printf("Failed to convert currentStr to int: %v, using default value 1", err)
		current = 1
	}
	size, err := strconv.ParseInt(sizeStr, 10, 64)
	if err != nil {
		log.Printf("Failed to convert sizeStr to int: %v, using default value 10", err)
		size = 10
	}
	status, err := strconv.ParseInt(statusStr, 10, 64)
	if err != nil || statusStr == "" {
		log.Printf("Failed to convert statusStr to int: %v, using default value 0", err)
		status = 0 // 或其他合适的默认值
	}

	userId, _, err := Common.CodeToken(token)
	if token == "" || err != nil {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code: "A00004",
			Data: nil,
			Msg:  "Unauthorized",
		})
		return
	}

	db := gorm.Db
	var dbresult []*MyOrderRes

	// 构建SQL查询
	query := db.Table("tz_order o").
		Select(`o.actual_total, oi.pic, oi.price, oi.prod_name, oi.sku_name, oi.prod_count, o.status,
o.order_number`).
		Joins("LEFT JOIN tz_order_item oi ON o.order_number = oi.order_number").
		Where("o.user_id = ? AND o.delete_status = 0", userId)

	if status != 0 {
		query = query.Where("o.status = ?", status)
	}

	// 分页
	offset := (current - 1) * size
	query = query.Offset(int(offset)).Limit(int(size))

	// 执行查询
	dbResult := query.Scan(&dbresult)
	if dbResult.Error != nil {
		log.Printf("Failed to execute query: %v", dbResult.Error)
	}
	// 计算总数
	var count int64
	countQuery := "SELECT COUNT(0) FROM tz_order WHERE user_id = ? AND delete_status = 0"
	countArgs := []interface{}{userId}

	if status != 0 {
		countQuery += " AND status = ?"
		countArgs = append(countArgs, status)
	}

	db.Raw(countQuery, countArgs...).Count(&count)

	var result []MyOrderDto
	for _, item := range dbresult {
		orderItemDto := MyOrderItemDto{
			Pic:         item.Pic,
			ProdName:    item.ProdName,
			ProdCount:   item.ProdCount,
			Price:       item.Price,
			SkuName:     item.SkuName,
			OrderNumber: item.OrderNumber,
		}
		result = append(result, MyOrderDto{
			ActualTotal:   item.ActualTotal,
			OrderItemDtos: []MyOrderItemDto{orderItemDto},
			OrderNumber:   item.OrderNumber,
			Status:        item.Status,
		})
	}
	if len(result) == 0 {
		result = []MyOrderDto{}
	}
	c.JSON(http.StatusOK, Response.ResponseBody{
		Code: "00000",
		Data: Common.PageParam1[MyOrderDto]{
			Current: current,
			Total:   count,
			Size:    size,
			Records: result,
			Pages:   int(math.Ceil(float64(count) / float64(size))),
		},
		Msg:       nil,
		Success:   true,
		Fail:      false,
		Version:   "1.0",
		Timestamp: time.Now().Unix(),
		Sign:      "",
	})
}

/*
OrderDetail
@Description: 订单详情
@param c
*/
func OrderDetail(c *gin.Context) {
	orderNumber := c.Query("orderNumber")
	token := c.GetHeader("Authorization")
	userId, _, err := Common.CodeToken(token)
	if token == "" || err != nil {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code: "A00004",
			Data: nil,
			Msg:  "Unauthorized",
		})
		return
	}
	var orderShopDto Dto.OrderShopDto
	db := gorm.Db
	var order *GormModel.TzOrder

	db.Where("order_number = ?", orderNumber).First(&order)
	if order == nil {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "订单不存在",
			Version: "1.0.0",
			Success: true,
		})
	}
	if order.UserID != userId {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "你没有权限获取该订单信息",
			Version: "1.0.0",
			Success: true,
		})
	}
	var shopDetail GormModel.TzShopDetail
	db.Where("shop_id = ?", order.ShopID).First(&shopDetail)
	var userAddrOrder *GormModel.TzUserAddrOrder
	db.Where("addr_order_id =?", order.AddrOrderID).First(&userAddrOrder)
	var userAddrDto Dto.UserAddrDto
	if err := copier.CopyWithOption(&userAddrDto, &userAddrOrder, copier.Option{IgnoreEmpty: true, DeepCopy: true}); err != nil {
		// 处理错误
		c.JSON(200, Response.ResponseBody{
			Code:    "A00005",
			Data:    nil,
			Success: true,
			Msg:     "服务器出了点小差",
		})
		return
	}
	//	select * from tz_order_item where order_number = #{orderNumber}
	var orderItem []GormModel.TzOrderItem
	db.Where("order_number = ?", orderNumber).Find(&orderItem)
	var orderItemList []Dto.OrderItemDto
	if err := copier.CopyWithOption(&orderItemList, &orderItem, copier.Option{IgnoreEmpty: true, DeepCopy: true}); err != nil {
		// 处理错误
		c.JSON(200, Response.ResponseBody{
			Code:    "A00005",
			Data:    nil,
			Success: true,
			Msg:     "服务器出了点小差",
		})
		return
	}

	orderShopDto.ShopID = shopDetail.ShopID
	orderShopDto.ShopName = shopDetail.ShopName
	orderShopDto.ActualTotal = *order.ActualTotal
	orderShopDto.OrderItemDtos = orderItemList
	orderShopDto.Transfee = order.FreightAmount
	orderShopDto.ReduceAmount = *order.ReduceAmount
	orderShopDto.CreateTime = order.CreateTime
	orderShopDto.Remarks = *order.Remarks
	orderShopDto.Status = order.Status

	total := 0.0
	totalNum := 0
	for _, orderItem := range orderShopDto.OrderItemDtos {
		total = total + orderItem.ProductTotalAmount
		totalNum += orderItem.ProdCount
	}
	orderShopDto.Total = total
	orderShopDto.TotalNum = totalNum
	c.JSON(http.StatusOK, Response.ResponseBody{
		Code:    "00000",
		Data:    orderShopDto,
		Msg:     nil,
		Version: "1.0.0",
		Success: true,
	})
}

/*
	OrderReceipt

@Description: 根据订单号确认收货
*/
func OrderReceipt(c *gin.Context) {
	orderNumber := c.Param("orderNumber")
	token := c.GetHeader("Authorization")
	userId, _, err := Common.CodeToken(token)
	if token == "" || err != nil {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code: "A00004",
			Data: nil,
			Msg:  "Unauthorized",
		})
		return
	}

	db := gorm.Db.Begin()
	defer func() {
		if r := recover(); r != nil {
			db.Rollback()
			c.JSON(200, Response.ResponseBody{
				Code:    "A00005",
				Data:    nil,
				Success: true,
				Msg:     "服务器出了点小差",
			})
		} else if err != nil {
			db.Rollback()
		} else {
			db.Commit()
		}
	}()

	// 查询订单
	var order GormModel.TzOrder // 使用具体类型而非指针
	if err := db.Where("order_number = ?", orderNumber).First(&order).Error; err != nil {

		err = fmt.Errorf("查询订单失败: %v", err)
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00005",
			Data:    nil,
			Msg:     "服务器内部错误",
			Version: "1.0.0",
			Success: true,
		})

		return // 终止执行
	}

	// 权限校验
	if order.UserID != userId {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "你没有权限获取该订单信息",
			Version: "1.0.0",
			Success: true,
		})
		return // 终止执行
	}

	// 状态校验
	if order.Status != Common.CONSIGNMENT.Value() {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "订单未发货,无法确认收货",
			Version: "1.0.0",
			Success: true,
		})
		return // 终止执行
	}

	// 查询订单项（可选，根据实际需求）
	var orderItems []GormModel.TzOrderItem
	if err := db.Where("order_number = ?", orderNumber).Find(&orderItems).Error; err != nil {
		err = fmt.Errorf("查询订单项失败: %v", err)
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00005",
			Data:    nil,
			Msg:     "服务器内部错误",
			Version: "1.0.0",
			Success: true,
		})
		return
	}
	order.OrderItems = orderItems

	// 更新订单状态（修复 IN 子句）
	// 注意：order.OrderID 是单个值，需转换为切片
	log.Println(" 插入的值", Common.CONFIRM.Value())
	result := db.Model(&GormModel.TzOrder{}).
		Where("order_id IN (?)", []uint64{order.OrderID}). // 强制转换为切片
		Updates(map[string]interface{}{
			//变成待评价
			"status":       Common.CONFIRM.Value(),
			"finally_time": time.Now(),
		})

	if result.Error != nil {
		err = fmt.Errorf("更新订单状态失败: %v", result.Error)
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00005",
			Data:    nil,
			Msg:     "服务器内部错误",
			Version: "1.0.0",
			Success: true,
		})
		return
	}
	//向区块链发送订单信息
	cfg, _ := ini.Load("./Config/config.ini")
	enabled := cfg.Section("blockchain").Key("enabled").String()
	url := cfg.Section("blockchain").Key("url").String()
	if enabled == "true" {

		go func() {
			// 安全构造 JSON
			reqBody, _ := json.Marshal(map[string]string{
				"orderNumber": orderNumber,
			})

			// 添加上下文超时
			ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
			defer cancel()

			// 创建 HTTP 请求
			req, _ := http.NewRequestWithContext(ctx, "POST", url+"/OrderReceipt",
				bytes.NewBuffer(reqBody))
			req.Header.Set("Content-Type", "application/json")

			// 发送请求
			resp, err := http.DefaultClient.Do(req)
			if err != nil {
				log.Printf("请求失败: %v", err)
				return
			}
			defer resp.Body.Close()

			// 处理非 200 状态码
			if resp.StatusCode != http.StatusOK {
				body, _ := io.ReadAll(resp.Body)
				log.Printf("操作失败: 状态码=%d, 响应=%s", resp.StatusCode, string(body))
				return
			}

			// 处理成功响应
			var result map[string]interface{}
			if err := json.NewDecoder(resp.Body).Decode(&result); err == nil {
				log.Printf("操作成功: %+v", result)
			}
		}()
	}
	// 成功响应
	c.JSON(http.StatusOK, Response.ResponseBody{
		Code:    "00000",
		Data:    nil,
		Msg:     nil,
		Version: "1.0.0",
		Success: true,
	})
}

/*
CancelOrder
@Description: 取消订单
@requestuest: UserId
*/
func CancelOrder(c *gin.Context) {
	UserId, err := Common.GetUserId(c)
	orderNumber := c.Query("orderNumber")
	db := gorm.Db.Begin()
	//回退函数
	defer func() {
		if r := recover(); r != nil {
			db.Rollback()
			c.JSON(200, Response.ResponseBody{
				Code:    "A00005",
				Data:    nil,
				Success: true,
				Msg:     "服务器出了点小差",
			})
		} else if err != nil {
			db.Rollback()
		} else {
			db.Commit()
		}
	}()
	var order GormModel.TzOrder
	db.Where("order_number =?", orderNumber).First(&order)
	if order.UserID != UserId {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "你没有权限获取该订单信息",
			Version: "1.0.0",
			Success: true,
		})
		return
	}
	if order.Status != Common.UNPAY.Value() {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "订单已支付，无法取消订单",
			Version: "1.0.0",
			Success: true,
		})
		return
	}
	var orderItems []GormModel.TzOrderItem
	db.Where("order_number =?").Find(&orderItems)
	order.OrderItems = orderItems
	// 取消订单
	cancelOrders([]GormModel.TzOrder{order})
	c.JSON(http.StatusOK, Response.ResponseBody{
		Code:    "00000",
		Data:    nil,
		Msg:     nil,
		Version: "1.0.0",
		Success: true,
	})
}

/*
cancelOrders
@Description: 取消订单实现
*/
func cancelOrders(orders []GormModel.TzOrder) {
	db := gorm.Db.Begin()
	//回退函数
	defer func() {
		if r := recover(); r != nil {
			db.Rollback()
		} else {
			db.Commit()
		}
	}()
	var orderIDs []uint64
	for _, order := range orders {
		orderIDs = append(orderIDs, order.OrderID)
	}

	// 批量更新订单状态
	result := db.Model(&GormModel.TzOrder{}).
		Where("order_id IN ?", orderIDs).
		Where("is_payed = 0").
		Updates(map[string]interface{}{
			"status":      6,
			"cancel_time": time.Now(),
		})
	if result.Error != nil {
		panic(result.Error)
	}
	var allOrderItems []GormModel.TzOrderItem
	for _, order := range orders {
		orderItems := order.OrderItems
		allOrderItems = append(allOrderItems, orderItems...)
	}
	if Util.SliceIsEmpty(allOrderItems) {
		return
	}
	/*
	   Map<Long, Integer> prodCollect = new HashMap<>(16);
	   Map<Long, Integer> skuCollect = new HashMap<>(16);
	*/
	var prodCollect = make(map[uint64]int)
	var skuCollect = make(map[uint64]int)
	/*
			     allOrderItems.stream().collect(Collectors.groupingBy(OrderItem::getProdId)).forEach((prodId, orderItems) -> {
		            int prodTotalNum = orderItems.stream().mapToInt(OrderItem::getProdCount).sum();
		            prodCollect.put(prodId, prodTotalNum);
		        });
	*/
	for _, orderItem := range allOrderItems {
		prodId := orderItem.ProdID
		prodCount := orderItem.ProdCount
		prodCollect[prodId] = prodCollect[prodId] + prodCount
	}
	/*
		<update id="returnStock">
		        <foreach collection="prodCollect" item="changeStocks" index="prodId" separator=";">
		            update tz_prod set total_stocks = total_stocks + #{changeStocks} where prod_id = #{prodId}
		        </foreach>
		    </update>
	*/
	// 回退商品库存
	for prodId, prodTotalNum := range prodCollect {
		// 使用原生SQL更新库存
		result := db.Exec("UPDATE tz_prod SET total_stocks = total_stocks + ? WHERE prod_id = ?", prodTotalNum, prodId)
		if result.Error != nil {
			panic(result.Error)
		}
	}
	/*
	   // 回退商品库存
	   if len(prodCollect) > 0 {
	       // 构建 IN 子句
	       var prodIds []interface{}
	       for prodId := range prodCollect {
	           prodIds = append(prodIds, prodId)
	       }

	       // 构建 SQL 语句
	       sql := `
	           UPDATE tz_prod
	           SET total_stocks = total_stocks + CASE prod_id
	       `
	       for prodId, prodTotalNum := range prodCollect {
	           sql += fmt.Sprintf("WHEN %d THEN %d ", prodId, prodTotalNum)
	       }
	       sql += "END"
	       sql += " WHERE prod_id IN (?"
	       for i := 1; i < len(prodIds); i++ {
	           sql += ", ?"
	       }
	       sql += ")"

	       // 执行批量更新
	       result := db.Exec(sql, append([]interface{}{prodIds[0]}, prodIds[1:]...)...)
	       if result.Error != nil {
	           panic(result.Error)
	       }
	   }

	*/
	/*
	   allOrderItems.stream().collect(Collectors.groupingBy(OrderItem::getSkuId)).forEach((skuId, orderItems) -> {
	         int prodTotalNum = orderItems.stream().mapToInt(OrderItem::getProdCount).sum();
	         skuCollect.put(skuId, prodTotalNum);
	     });
	*/
	for _, orderItem := range allOrderItems {
		skuId := orderItem.SkuID
		prodCount := orderItem.ProdCount
		skuCollect[skuId] = skuCollect[skuId] + prodCount
	}

	/*

			<update id="returnStock">
		       <foreach collection="skuCollect" item="changeStocks" index="skuId" separator=";">
		       update tz_sku set stocks = stocks + #{changeStocks} where sku_id = #{skuId}
		       </foreach>
		    </update>
	*/
	for skuId, SkuTotalNum := range skuCollect {
		// 使用原生SQL更新库存
		result := db.Exec("UPDATE tz_sku SET stocks = stocks + ? WHERE sku_id = ?", SkuTotalNum, skuId)
		if result.Error != nil {
			panic(result.Error)
		}
	}

}

func DeleOrdersByOrderNumber(c *gin.Context) {
	orderNumber := c.Query("orderNumber")
	UserId, err := Common.GetUserId(c)
	db := gorm.Db.Begin()
	defer func() {
		if r := recover(); r != nil {
			db.Rollback()
			c.JSON(200, Response.ResponseBody{
				Code:    "A00005",
				Data:    nil,
				Success: true,
				Msg:     "服务器出了点小差",
			})
		} else if err != nil {
			db.Rollback()
		} else {
			db.Commit()
		}
	}()

	var order *GormModel.TzOrder
	db.Where("order_number =?", orderNumber).Find(&order)
	if order == nil {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "该订单不存在",
			Version: "1.0.0",
			Success: true,
		})
		return
	}
	if order.UserID != UserId {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "你没有权限获取该订单信息",
			Version: "1.0.0",
			Success: true,
		})
		return
	}
	if (order.Status == Common.SUCCESS.Value()) && order.Status != Common.CLOSE.Value() {
		c.JSON(http.StatusOK, Response.ResponseBody{
			Code:    "A00001",
			Data:    nil,
			Msg:     "订单未完成或未关闭，无法删除订单",
			Version: "1.0.0",
			Success: true,
		})
		return
	}
	// 删除订单
	/*

	   <update id="deleteOrders">
	       UPDATE tz_order SET `delete_status`=2
	       WHERE order_id IN
	       <foreach collection="orders" item="order" open="(" close=")" separator=",">
	           #{order.orderId}
	       </foreach>
	   </update>
	*/
	deleteOrders := []GormModel.TzOrder{*order}
	var orderIDs []uint64
	for _, order := range deleteOrders {
		orderIDs = append(orderIDs, order.OrderID)
	}

	result := db.Model(&GormModel.TzOrder{}).Where("order_id IN ?", orderIDs).Update("delete_status", 2)
	if result.Error != nil {
		panic(result.Error)
	}

	c.JSON(http.StatusOK, Response.ResponseBody{
		Code:    "00000",
		Data:    nil,
		Msg:     "删除成功",
		Version: "1.0.0",
		Success: true,
	})
}
